﻿<s:SurfaceUserControl x:Class="MediaSurface.SurfaceUserControl1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:s="http://schemas.microsoft.com/surface/2008" Margin="4" ClipToBounds="True" Background="Transparent" Height="Auto" Width="Auto">




    <DockPanel  Background="Transparent"  Width="Auto" Height="Auto" LastChildFill="False" >

        <DockPanel Background="Gray" DockPanel.Dock="Top">
            <s:SurfaceButton Background ="Beige"  Width="60"   DockPanel.Dock="Right" Click="SurfaceButton_Click" FontSize="14" FontWeight="Bold">X</s:SurfaceButton>
            <Label Height="28" Width="Auto" Name="Title_Label" Background="DarkGray" Margin="0" FontWeight="Bold" ToolTip="Show the Title" Foreground="Black">Currently Playing</Label>
            <Label Height="28" Width="Auto" Name="Remaining_Time_Label" Margin="0" Background="DarkGray" Foreground="Black">Remaining Time</Label>
        </DockPanel>


        <DockPanel DockPanel.Dock="Top" Visibility="Visible"    LastChildFill="True" x:Name="mediaControls">

           
            <MediaElement  Margin="0"
                              Name="McMediaElement" 
                              
                              Height="Auto"
                          
                              LoadedBehavior="Manual" 
                              UnloadedBehavior="Stop" 
                                  
                              IsHitTestVisible="True"
                              MediaOpened="Element_MediaOpened" 
                              MediaEnded="Element_MediaEnded" DockPanel.Dock="Top"
                            Width="Auto" Volume="0.4" ClipToBounds="False" Stretch="Uniform" >


            </MediaElement>
            
            
            <StackPanel Name="mediaInfo_StackPanel"  VerticalAlignment="Center" Visibility="Visible"  Orientation="Vertical" Height="240" Width="240" TextBlock.Foreground="Yellow"  Background="Black" DockPanel.Dock="Left">

                <StackPanel Orientation="Horizontal" >
                    <Label Foreground="White" VerticalAlignment="Center" >Title :</Label>
                    <TextBlock VerticalAlignment="Center" Name="title_textBox"  Width="180"  TextWrapping="Wrap"></TextBlock>
                </StackPanel>


                <StackPanel Orientation="Horizontal">
                    <Label Foreground="White" VerticalAlignment="Center" >Genre :</Label>
                    <TextBlock VerticalAlignment="Center"  Name="tag_textBox"  Width="180"  TextWrapping="Wrap"></TextBlock>
                </StackPanel>

                <StackPanel Orientation="Horizontal">
                    <Label Foreground="White"  VerticalAlignment="Center" >Description :</Label>
                    <TextBlock VerticalAlignment="Center" Name="description_textBox" Width="180"  TextWrapping="Wrap"></TextBlock>
                </StackPanel>

                <StackPanel Orientation="Horizontal">
                    <Label Foreground="White"  VerticalAlignment="Center" >Length :</Label>
                    <TextBlock Name="length_textBox" Width="30" VerticalAlignment="Center"  TextWrapping="Wrap"></TextBlock>
                    <Label Foreground="White" VerticalAlignment="Center" >minutes</Label>
                </StackPanel>

                
                <StackPanel Orientation="Horizontal">
                    <Label Foreground="White" VerticalAlignment="Center" >Uploaded By :</Label>
                    <TextBlock VerticalAlignment="Center" Name="pool_textBox" Width="180"  TextWrapping="Wrap"></TextBlock>
                </StackPanel>
                
                <StackPanel Orientation="Horizontal">
                    <Label Foreground="White" VerticalAlignment="Center" >Aspect Ratio :</Label>
                    <TextBlock VerticalAlignment="Center" Name= "aspect_Ratio_textBox" Width="180"  TextWrapping="Wrap"> </TextBlock>
                </StackPanel>


            </StackPanel>

            <StackPanel Name="thumbnail_stackPanel"  Visibility="Visible" VerticalAlignment="Center" Width="180" Background="Black" DockPanel.Dock="Right">
                <Image Name="movie_thumnnail" Source="C:\\Images\\Background2.jpg" Height="240" Width="180" VerticalAlignment="Center"  ></Image>
            </StackPanel>








            
        </DockPanel>
      
            <StackPanel Background="DarkGray" Width="Auto"  Height="50" Orientation="Horizontal"  VerticalAlignment="Bottom" DockPanel.Dock="Top" >

          
                <Image Name="Play_Image" Source="images\control_play.png"   s:Contacts.ContactDown="OnContactDownPlayMedia" Margin="5"  />

          

                <!-- Seek to slider. Ths slider allows you to jump to different parts of the media playback. -->
                <TextBlock Foreground="White" Margin="5"  VerticalAlignment="Center">Seek To</TextBlock>
                <s:SurfaceSlider Name="timelineSlider"  VerticalAlignment="Center" Height="10" Margin="5" ValueChanged="SeekToMediaPosition" ContactDown="slider_ContactChanged" ContactUp="slider_ContactChanged" MinWidth="180"/>

                <!-- Volume slider. This slider allows a Volume range between 0 and 1. -->
                <TextBlock Foreground="White" VerticalAlignment="Center" Margin="5"  >Volume</TextBlock>
                <s:SurfaceSlider Name="volumeSlider" VerticalAlignment="Center" ValueChanged="ChangeMediaVolume" 
                        Minimum="0" Maximum="1" Value="0.5"   MinWidth="70"/>

           </StackPanel>
       
    </DockPanel>
    
</s:SurfaceUserControl>
